from selenium import webdriver

class BasePage:
    def __init__(self):
        self.driver = None
    # 打开浏览器
    def open_browser(self):
        self.driver=webdriver.Edge()
        self.driver.implicitly_wait(10)
        self.driver.maximize_window()
    # 加载网页
    def get(self,url):
        self.driver.get(url)
    # 元素定义封装
    def locator_element(self,args):
        return self.driver.find_element(*args)
    # 设置值
    def send_keys(self,args,value):
        self.locator_element(args).send_keys(value)
    # 点击
    def click(self,args):
        self.locator_element(args).click()
    def jump_iframe(self,args):
        iframe=self.locator_element(args)
        self.driver.switch_to.frame(iframe)
    def back_iframe(self):
        self.driver.switch_to.default_content()
    def clear(self,args):
        self.locator_element(args).clear()




